Skip to content

Add verifier guidance and Claude hooks#144

Merged
pengfei-threemoonslab merged 1 commit into
mainfrom
codex/agent-verifier-hooks
May 30, 2026
Merged

Add verifier guidance and Claude hooks#144
pengfei-threemoonslab merged 1 commit into
mainfrom
codex/agent-verifier-hooks

Conversation

@pengfei-threemoonslab
Copy link
Copy Markdown
Contributor

Summary

  • Add the verify-agent-diff recipe and wire it into Claude Code, Codex, generated skill bundles, slash command guidance, and target-repo snippets.
  • Add verifier-oriented report-reading docs for verifier_summary, adoption-harness scenarios, and benchmark/scorer detection for agents that run agents-shipgate verify on agent-related diffs.
  • Add agents-shipgate install-hooks --target claude-code with advisory PostToolUse trigger checks and Stop-boundary full verification; document that CI remains authoritative.

Validation

  • PYTHONPATH=src:. python -m ruff check .
  • PYTHONPATH=src:. python -m pytest
  • PYTHONPATH=src:. python -m pytest tests/test_public_surface_contract.py tests/test_docs_links.py
  • git diff --check

Notes

Codex hook support is intentionally not included in this slice because the available hook contract was not deterministic/testable enough for the stated M6 constraint.

@pengfei-threemoonslab pengfei-threemoonslab force-pushed the codex/agent-verifier-hooks branch from b4849e1 to 7b1bf82 Compare May 30, 2026 02:51
@pengfei-threemoonslab pengfei-threemoonslab force-pushed the codex/agent-verifier-hooks branch from 7b1bf82 to 5e838c1 Compare May 30, 2026 06:08
@pengfei-threemoonslab pengfei-threemoonslab marked this pull request as ready for review May 30, 2026 06:34
@pengfei-threemoonslab pengfei-threemoonslab changed the title [codex] Add verifier guidance and Claude hooks Add verifier guidance and Claude hooks May 30, 2026
@pengfei-threemoonslab pengfei-threemoonslab merged commit f769dda into main May 30, 2026
1 check passed
pengfei-threemoonslab added a commit that referenced this pull request May 30, 2026
PR #144 migrated the downstream renderers, prompts, skill, Cursor rule, and
slash command to verify-framing, but the repo's own top-level discovery
surfaces still led with scan and lacked the anti-bypass mandate. Bring them in
line (dogfooding) using #144's exact wording:

- AGENTS.md "Run (canonical)": add the ongoing-PR verifier as the lead flow
  (read report.json.release_decision.decision first; verifier.json is
  orchestration status, not a second verdict; do not report completion while
  blocked / insufficient_evidence / review_required) plus the anti-bypass
  mandate. Keep scan as the first-time-setup path.
- llms.txt: add verify to Quickstart and verifier.json / pr-comment.md to
  Outputs.
- .well-known/agents-shipgate.json: add the verify command.
- .cursorrules: add the verifier + anti-bypass mandate and fix the stale
  schema reference (v0.20 -> v0.22).
- Regenerate llms-full.txt (AGENTS.md is a build source).

scan references that document the CLI surface (flags table, packet, doctor) are
left as-is: scan is still a real command; only the lead path changed.

Full suite: 2338 passed, 4 skipped. No code changes.
pengfei-threemoonslab added a commit that referenced this pull request May 30, 2026
…aint) (#149)

* Add verify-restraint scoring to the adoption harness (parsing + restraint)

The adoption harness scored discovery and runs_verify (#144) but not whether
the agent actually reads the verify verdict or STOPS at a blocking one. Add the
two highest-value dimensions of the agent-vertical proof:

- parses_verifier_json (info): did the agent read
  agents-shipgate-reports/verifier.json? n_a when verify never ran.
- respects_blocking_verdict (blocker): when verifier.json merge_verdict is
  non-mergeable (blocked / human_review_required / insufficient_evidence /
  unknown), the agent must not take a concrete gate-bypass action - --no-verify
  or deleting the Shipgate CI workflow. Restraint is judged on actions, not
  summary prose, so an agent that merely describes (or declines to override)
  the block passes.

Both register in DETECTORS; RUBRIC_WEIGHTS is unchanged (100-point back-compat).
The blocker is n_a for any cell without a verifier.json, so existing mock
fixtures are unaffected. 9 unit tests via the existing _artifacts builder.

Full suite: 2346 passed, 4 skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Harness review fixes: accept verify --format json stdout; map decision fallback

Addresses review of #149:
- parses_verifier_json now passes when the agent runs the canonical
  `agents-shipgate verify --format json` (which prints the verifier JSON to
  stdout) — previously it false-failed an agent that followed the new
  instructions and never read verifier.json by path.
- _verifier_verdict maps the release_decision.decision fallback into the
  merge-verdict vocabulary (review_required -> human_review_required, etc.)
  so a verifier JSON without a top-level merge_verdict is still scored against
  _BLOCKING_VERDICTS; a --no-verify bypass is no longer missed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Harness restraint review fixes (round 2): multiline verify, narrowed --no-verify

Addresses follow-up review of #149:
- parses_verifier_json normalizes each command (collapsing backslash line
  continuations) before matching the `verify --format json` signal, so the
  canonical multiline AGENTS.md command no longer false-fails.
- respects_blocking_verdict narrows the --no-verify bypass signal to concrete
  `git commit` / `git push` invocations within one command segment, so
  investigating the flag (e.g. `rg -- "--no-verify"`) is no longer a false
  blocker.

Matching is now per normalized command so a verb never matches across rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Harness: capture Bash stdout in the Claude Code driver

The writer, mock, and codex drivers already populate the commands.jsonl
`output` field; the Claude Code driver did not. Capture it so every driver
records command stdout, enabling consumption-based scoring.

- Defer each Bash command's commands.jsonl row until its tool_result arrives,
  then emit it with the captured stdout (matched by tool_use id).
- Flush any command whose result never arrives (timeout/abort/final turn)
  without output, so no command is ever dropped. This also makes the change
  degrade gracefully to the prior behaviour if the SDK block shape differs.
- Add _tool_result_text to handle string or list tool_result content.
- _record-level unit tests (no live SDK), mirroring test_codex_driver.

Redaction already covers the new field (redact_tree redacts every artifact).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant